<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <#if parent??>
        <parent>
            <groupId>${parent.groupId}</groupId>
            <artifactId>${parent.artifactId}</artifactId>
            <#if imRoot>
                <version>${parent.version}</version>
            <#else>
                <version>${r"${revision}"}</version>
            </#if>
        </parent>
    </#if>

    <#if imRoot>
        <groupId>${groupId}</groupId>
    </#if>
    <artifactId>${artifactId}</artifactId>
    <#if imRoot>
        <version>${r"${revision}"}</version>
    </#if>
    <name>${name}</name>
    <#if imRoot>
        <#if imStarter>
            <packaging>jar</packaging>
        <#else >
            <packaging>pom</packaging>
        </#if>
    </#if>
    <#if imRoot>
        <description>${description}</description>
    </#if>

    <#if properties??>
        <properties>
        <#list properties? keys as key>
            <${key}>${properties[key]}</${key}>
        </#list>
        </properties>
    </#if>

    <#if modules?? && (modules?size > 0) >
        <modules>
            <#list modules as m>
                <module>${m}</module>
            </#list>
        </modules>
    </#if>

    <dependencies>
        <#if dependencyModules?? && (dependencyModules?size > 0) >
            <#list dependencyModules as m>
                <dependency>
                    <groupId>${groupId}</groupId>
                    <artifactId>${m}</artifactId>
                    <#if imRoot>
                        <version>${r"${revision}"}</version>
                    </#if>
                </dependency>
            </#list>
        </#if>
    <#if dependencies?? && (dependencies?size > 0)>
            <#list dependencies as d>
                <dependency>
                    <groupId>${d.groupId}</groupId>
                    <artifactId>${d.artifactId}</artifactId>
                    <#if d.version??>
                        <version>${d.version}</version>
                    </#if>
                    <#if d.optional??>
                        <optional>${d.optional}</optional>
                    </#if>
                    <#if d.scope??>
                        <scope>${d.scope}</scope>
                    </#if>
                    <#if d.exclusions?? && (d.exclusions?size > 0)>
                        <exclusions>
                            <#list d.exclusions as exclusion>
                                <exclusion>
                                    <groupId>${exclusion.groupId}</groupId>
                                    <artifactId>${exclusion.artifactId}</artifactId>
                                </exclusion>
                            </#list>
                        </exclusions>
                    </#if>
                </dependency>
            </#list>
    </#if>
    </dependencies>
    <build>

    <#if imStarter>
        <plugins>
            <plugin>
                <groupId>com.tuya.boot</groupId>
                <artifactId>tuya-boot-plugin</artifactId>
                <#if mainClass??>
                    <configuration>
                        <mainClass>${mainClass}</mainClass>
                    </configuration>
                </#if>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </#if>
    </build>
</project>
